ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

React ES6 Snippets

by mboperator ALL

ES6 based Sublime Text snippets for React.

Labels snippets, jsx, es6, react

Details

  • 0.5.0
  • github.​com
  • 8 years ago
  • 39 minutes ago
  • 10 years ago

Installs

  • Total 91K
  • Win 44K
  • Mac 33K
  • Linux 14K
May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5
Windows 3 0 0 2 3 0 0 1 1 2 1 1 1 1 2 1 0 2 1 2 2 1 1 3 0 1 3 2 0 3 3 1 2 1 2 1 1 0 1 3 0 2 2 0 0 2
Mac 0 0 0 0 1 1 1 0 0 0 1 2 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 1 0 0
Linux 0 2 3 0 0 0 0 1 2 2 1 0 1 2 3 0 0 1 0 1 1 3 1 1 1 0 1 4 1 2 0 2 0 0 2 1 0 1 2 0 0 0 0 2 1 1
0246May 20May 17May 14May 11May 8May 5May 2Apr 29Apr 26Apr 23Apr 20Apr 17Apr 14Apr 11Apr 8Apr 5May 20 Linux: 0 Mac: 0 Windows: 3May 19 Linux: 2 Mac: 0 Windows: 0May 18 Linux: 3 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 2May 16 Linux: 0 Mac: 1 Windows: 3May 15 Linux: 0 Mac: 1 Windows: 0May 14 Linux: 0 Mac: 1 Windows: 0May 13 Linux: 1 Mac: 0 Windows: 1May 12 Linux: 2 Mac: 0 Windows: 1May 11 Linux: 2 Mac: 0 Windows: 2May 10 Linux: 1 Mac: 1 Windows: 1May 9 Linux: 0 Mac: 2 Windows: 1May 8 Linux: 1 Mac: 1 Windows: 1May 7 Linux: 2 Mac: 0 Windows: 1May 6 Linux: 3 Mac: 0 Windows: 2May 5 Linux: 0 Mac: 0 Windows: 1May 4 Linux: 0 Mac: 0 Windows: 0May 3 Linux: 1 Mac: 0 Windows: 2May 2 Linux: 0 Mac: 1 Windows: 1May 1 Linux: 1 Mac: 0 Windows: 2Apr 30 Linux: 1 Mac: 0 Windows: 2Apr 29 Linux: 3 Mac: 0 Windows: 1Apr 28 Linux: 1 Mac: 0 Windows: 1Apr 27 Linux: 1 Mac: 0 Windows: 3Apr 26 Linux: 1 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 0 Windows: 1Apr 24 Linux: 1 Mac: 1 Windows: 3Apr 23 Linux: 4 Mac: 0 Windows: 2Apr 22 Linux: 1 Mac: 0 Windows: 0Apr 21 Linux: 2 Mac: 0 Windows: 3Apr 20 Linux: 0 Mac: 0 Windows: 3Apr 19 Linux: 2 Mac: 0 Windows: 1Apr 18 Linux: 0 Mac: 1 Windows: 2Apr 17 Linux: 0 Mac: 0 Windows: 1Apr 16 Linux: 2 Mac: 0 Windows: 2Apr 15 Linux: 1 Mac: 1 Windows: 1Apr 14 Linux: 0 Mac: 1 Windows: 1Apr 13 Linux: 1 Mac: 1 Windows: 0Apr 12 Linux: 2 Mac: 1 Windows: 1Apr 11 Linux: 0 Mac: 1 Windows: 3Apr 10 Linux: 0 Mac: 0 Windows: 0Apr 9 Linux: 0 Mac: 0 Windows: 2Apr 8 Linux: 0 Mac: 0 Windows: 2Apr 7 Linux: 2 Mac: 1 Windows: 0Apr 6 Linux: 1 Mac: 0 Windows: 0Apr 5 Linux: 1 Mac: 0 Windows: 2May 20 Linux: 0 Mac: 0 Windows: 3May 19 Linux: 2 Mac: 0 Windows: 0May 18 Linux: 3 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 2May 16 Linux: 0 Mac: 1 Windows: 3May 15 Linux: 0 Mac: 1 Windows: 0May 14 Linux: 0 Mac: 1 Windows: 0May 13 Linux: 1 Mac: 0 Windows: 1May 12 Linux: 2 Mac: 0 Windows: 1May 11 Linux: 2 Mac: 0 Windows: 2May 10 Linux: 1 Mac: 1 Windows: 1May 9 Linux: 0 Mac: 2 Windows: 1May 8 Linux: 1 Mac: 1 Windows: 1May 7 Linux: 2 Mac: 0 Windows: 1May 6 Linux: 3 Mac: 0 Windows: 2May 5 Linux: 0 Mac: 0 Windows: 1May 4 Linux: 0 Mac: 0 Windows: 0May 3 Linux: 1 Mac: 0 Windows: 2May 2 Linux: 0 Mac: 1 Windows: 1May 1 Linux: 1 Mac: 0 Windows: 2Apr 30 Linux: 1 Mac: 0 Windows: 2Apr 29 Linux: 3 Mac: 0 Windows: 1Apr 28 Linux: 1 Mac: 0 Windows: 1Apr 27 Linux: 1 Mac: 0 Windows: 3Apr 26 Linux: 1 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 0 Windows: 1Apr 24 Linux: 1 Mac: 1 Windows: 3Apr 23 Linux: 4 Mac: 0 Windows: 2Apr 22 Linux: 1 Mac: 0 Windows: 0Apr 21 Linux: 2 Mac: 0 Windows: 3Apr 20 Linux: 0 Mac: 0 Windows: 3Apr 19 Linux: 2 Mac: 0 Windows: 1Apr 18 Linux: 0 Mac: 1 Windows: 2Apr 17 Linux: 0 Mac: 0 Windows: 1Apr 16 Linux: 2 Mac: 0 Windows: 2Apr 15 Linux: 1 Mac: 1 Windows: 1Apr 14 Linux: 0 Mac: 1 Windows: 1Apr 13 Linux: 1 Mac: 1 Windows: 0Apr 12 Linux: 2 Mac: 1 Windows: 1Apr 11 Linux: 0 Mac: 1 Windows: 3Apr 10 Linux: 0 Mac: 0 Windows: 0Apr 9 Linux: 0 Mac: 0 Windows: 2Apr 8 Linux: 0 Mac: 0 Windows: 2Apr 7 Linux: 2 Mac: 1 Windows: 0Apr 6 Linux: 1 Mac: 0 Windows: 0Apr 5 Linux: 1 Mac: 0 Windows: 2May 20 Linux: 0 Mac: 0 Windows: 3May 19 Linux: 2 Mac: 0 Windows: 0May 18 Linux: 3 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 2May 16 Linux: 0 Mac: 1 Windows: 3May 15 Linux: 0 Mac: 1 Windows: 0May 14 Linux: 0 Mac: 1 Windows: 0May 13 Linux: 1 Mac: 0 Windows: 1May 12 Linux: 2 Mac: 0 Windows: 1May 11 Linux: 2 Mac: 0 Windows: 2May 10 Linux: 1 Mac: 1 Windows: 1May 9 Linux: 0 Mac: 2 Windows: 1May 8 Linux: 1 Mac: 1 Windows: 1May 7 Linux: 2 Mac: 0 Windows: 1May 6 Linux: 3 Mac: 0 Windows: 2May 5 Linux: 0 Mac: 0 Windows: 1May 4 Linux: 0 Mac: 0 Windows: 0May 3 Linux: 1 Mac: 0 Windows: 2May 2 Linux: 0 Mac: 1 Windows: 1May 1 Linux: 1 Mac: 0 Windows: 2Apr 30 Linux: 1 Mac: 0 Windows: 2Apr 29 Linux: 3 Mac: 0 Windows: 1Apr 28 Linux: 1 Mac: 0 Windows: 1Apr 27 Linux: 1 Mac: 0 Windows: 3Apr 26 Linux: 1 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 0 Windows: 1Apr 24 Linux: 1 Mac: 1 Windows: 3Apr 23 Linux: 4 Mac: 0 Windows: 2Apr 22 Linux: 1 Mac: 0 Windows: 0Apr 21 Linux: 2 Mac: 0 Windows: 3Apr 20 Linux: 0 Mac: 0 Windows: 3Apr 19 Linux: 2 Mac: 0 Windows: 1Apr 18 Linux: 0 Mac: 1 Windows: 2Apr 17 Linux: 0 Mac: 0 Windows: 1Apr 16 Linux: 2 Mac: 0 Windows: 2Apr 15 Linux: 1 Mac: 1 Windows: 1Apr 14 Linux: 0 Mac: 1 Windows: 1Apr 13 Linux: 1 Mac: 1 Windows: 0Apr 12 Linux: 2 Mac: 1 Windows: 1Apr 11 Linux: 0 Mac: 1 Windows: 3Apr 10 Linux: 0 Mac: 0 Windows: 0Apr 9 Linux: 0 Mac: 0 Windows: 2Apr 8 Linux: 0 Mac: 0 Windows: 2Apr 7 Linux: 2 Mac: 1 Windows: 0Apr 6 Linux: 1 Mac: 0 Windows: 0Apr 5 Linux: 1 Mac: 0 Windows: 2

Readme

Source
raw.​githubusercontent.​com

sublime-react-es6

This is a fork of Facebook's original ReactJS Sublime Package.

The main changes I've made include:

  • Converting function declarations to the new ES6 shorthand.

  • Static class variables (defaultProps, propTypes) are declared using ES7 property intializers.

  • ES6 style exports and imports for component creating snippets.

  • Added rrc for Redux connected components.

alt tag

Installation

Install the React package via Sublime's Package Manager

You will need the Sublime Package Manager.

  • Open the command palette: ⌘+shift+p on MacOS/Linux, ctrl+shift+p on Windows

  • type install, select Package Control: Install Package

  • type React, select React ES6 Snippets

Usage

Syntax highlighting

Syntax highlighting is no longer provided by this packages. We recommend that you use (babel-sublime) instead.

Snippets

It's easy! Simply activate snippets by typing a mnemonic followed by TAB.

alt tag

Documentation of available snippets (JSX):

cdm→  componentDidMount: fn() { ... }

   cdup→  componentDidUpdate: fn(pp, ps) { ... }

     cs→  import cx from 'classnames';

    cwm→  componentWillMount: fn() { ... }

    cwr→  componentWillReceiveProps: fn(np) { ... }

    cwu→  componentWillUpdate: fn(np, ns) { ... }

   cwun→  componentWillUnmount: fn() { ... }

     cx→  cx({ ... })

    fdn→  React.findDOMNode(...)

    fup→  forceUpdate(...)

    gdp→  static defaultProps = { ... } 

    gis→  getInitialState: fn() { return {...} } 

    ism→  isMounted()

  props→  this.props.

     pt→  propTypes { ... }

    rcc→  component skeleton

   refs→  this.refs.

    ren→  render: fn() { return ... }

    rpc→  pure render component skeleton

    rrc→  redux component skeleton

    scu→  shouldComponentUpdate: fn(np, ns) { ... }

    sst→  this.setState({ ... })

  state→  this.state.

Contributing

Rebuilding the docs

After making changes to snippet files, run npm install && npm run build-docs to automatically generate this document from source. Do not make changes to README.md directly.